//
//  Config.h
//  袋鼠车管家
//
//  Created by czy001 on 17/4/28.
//  Copyright © 2017年 czy001. All rights reserved.
//

#ifndef Config_h
#define Config_h

//定义返回请求数据的block类型
typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCode);
typedef void (^FailureBlock)();
typedef void (^NetWorkBlock)(BOOL netConnetState);

#define SCREENWIDTH [UIScreen mainScreen]. bounds.size.width
#define SCREENHEIGHT [UIScreen mainScreen]. bounds.size.height

#define RequestFailure [DSUtility mbSay:@"网络请求错误" delay:1]

#define DDLog(xx, ...)  NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

//判断是否为iPhoneX
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
// 是否为iOS7
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)

#define KNOTIFICATION_LOGINCHANGE @"loginStateChange"
#define PAGE_LENGTH 10

//主色调
#define MainColor RGBACOLOR(101,145,253,1)

//主标题
#define TitleColor RGBACOLOR(51,51,51,1)

//副标题
#define SubTitleColor RGBACOLOR(127,127,127,1)

//分割线颜色
#define LineColor RGBACOLOR(221,221,221,1)

#define FORMAT(format, ...)     [NSString stringWithFormat:(format), ##__VA_ARGS__]

//判断非空
#define JSON(P)                 FORMAT(@"%@", ([NetRequestClass isNull:P]? @"": P))

//tabbar高度
#define TabBarHeight (IS_IPHONE_X  ? 83: 49)

//状态栏高度
#define StatusBarHeight (IS_IPHONE_X  ? 44: 20)


//tabbar高度
#define TabBarHeight (IS_IPHONE_X  ? 83: 49)

//状态栏高度
#define StatusBarHeight (IS_IPHONE_X  ? 44: 20)

//导航条高度
#define NavBarHeight (IS_IPHONE_X  ? 88: 64)

//iPhone X底部留白
#define BottomHeight (IS_IPHONE_X  ? 34: 0)
// 颜色
#define DGHColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]

// 颜色/透明度
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define DGHColorAlpha(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
#define MAIN_COLOR RGBACOLOR(9, 192, 199, 1)
#define LOGINFONT 15

#define SERVICE_IP @"http://118.178.188.69:9080"
#define SERVICE_SHARE @"http://118.178.188.69:9080"

//#define SERVICE_IP @"http://192.168.1.57:8080"
////#define SERVICE_IP @"http://192.168.1.133:8080"
//#define SERVICE_IP @"http://192.168.1.45:8080"

//#define SERVICE_IP @"http://api.daishucgj.com"
//#define SERVICE_SHARE @"http://api.daishucgj.com"

//导航条高度
#define NavBarHeight (IS_IPHONE_X  ? 88: 64)

//iPhone X底部留白
#define BottomHeight (IS_IPHONE_X  ? 34: 0)

#define SHARE_INFORMATION @"/pub/infoContent?infoId="           //资讯分享
#define SHARE_GOODS       @"/pub/goodsView?goodsId="            //商品详情分享
#define SHARE_ACTIVITY    @"/pub/activity?activityId="          //活动详情分享
#define SHARE_CASESHOW    @"/pub/info?infoId="                  //案例展示分享

typedef NS_ENUM(NSInteger, WJShareType){
    WJShareTypeOwner = 0,     //车主端
    WJShareTypeStore,         //门店端
    WJShareTypeCustom,        //自定义
};

typedef NS_ENUM(NSInteger,TimeShowMode){
    /**
     * 只显示今天之前的时间
     */
    ShowTimeBeforeToday = 1,
    /**
     * 显示今天之后的时间
     */
    ShowTimeAfterToday,
    /**
     * 不限制时间
     */
    ShowAllTime,
    
};

#define WJCOLOR_LIAGHTGRAY      [UIColor colorWithRed:0.90f green:0.90f blue:0.90f alpha:1.00f]
#define WJCOLOR_GREEN           [UIColor colorWithRed:0.03f green:0.75f blue:0.78f alpha:1.00f] //主题色
#define WJCOLOR_RED             [UIColor colorWithRed:0.98f green:0.44f blue:0.44f alpha:1.00f]
#define WJCOLOR_YELLOW          [UIColor colorWithRed:0.98f green:0.82f blue:0.30f alpha:1.00f]
#define WJCOLOR_WHITE           [UIColor colorWithRed:1.00f green:1.00f blue:1.00f alpha:1.00f]
#define WJCOLOR_GRAY            [UIColor colorWithRed:0.59f green:0.59f blue:0.59f alpha:1.00f]
#define WJCOLOR_BLACK           [UIColor colorWithRed:0.00f green:0.00f blue:0.00f alpha:1.00f]
#define WJCOLOR_CLEAR           [UIColor clearColor]
#define WJCOLOR_ORANGE          [UIColor colorWithRed:0.96f green:0.47f blue:0.20f alpha:1.00f]
//透明的黑色蒙版
#define WJCOLOR_ALPHA           [UIColor colorWithRed:0.40f green:0.40f blue:0.40f alpha:1.00f]
//定义UIImage对象
#define WJIMAGE(_pointer)       [UIImage imageNamed:_pointer]

//当前登陆的手机号
#define PhoneFilePath [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject] stringByAppendingPathComponent:@"phone.data"]
//当前登陆的密码
#define PhonePwdFilePath [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject] stringByAppendingPathComponent:@"phonePwd.data"]

//当前登录信息
#define LoginFilePath [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject] stringByAppendingPathComponent:@"Login.data"]

#endif /* Config_h */
